package com.hushao.lims.weblims.repository;

import com.hushao.lims.weblims.domain.ConsumableInfo;
import com.hushao.lims.weblims.domain.ConsumableRepertory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

/**
 * @author 930588706
 * @date 18/1/18
 */
public interface ConsumableRepertoryRepository extends JpaRepository<ConsumableRepertory,Long> {

    /**
     * 根据耗材名称模糊查询数量大于0的耗材（分页）
     * @param count
     * @param consumableName
     * @param pageable
     * @return
     */
    Page<ConsumableRepertory> findByConsumableCountGreaterThanAndConsumableInfo_ConsumableNameLike(int count, String consumableName, Pageable pageable);

    /**
     * 根据耗材信息查询其库存
     * @param consumableInfo
     * @return
     */
    ConsumableRepertory findByConsumableInfo(ConsumableInfo consumableInfo);
}
